﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Vit.Web.Mvc.DataAnnotations
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)]
    public sealed class ShowForAttribute : AdditionalAttribute
    {
        public ShowForAttribute()
            : this(true, true, true, false)
        {
        }

        public ShowForAttribute(bool showForGrid, bool showForDetail, bool showForEdit, bool showForFilter)
        {
            ShowForGrid = showForGrid;
            ShowForDetail = showForDetail;
            ShowForEdit = showForEdit;
            ShowForFilter = showForFilter;
        }

        public bool ShowForGrid { get; set; }
        public bool ShowForDetail { get; set; }
        public bool ShowForEdit { get; set; }
        public bool ShowForFilter { get; set; }

        public const string AttributeKey = "ShowFor";
        public override string AddtionalKey
        {
            get { return AttributeKey; }
        }
    }
}
